﻿@model Orange.Mvc4App.Models.Module
@{
    var parList = (IList<Orange.Mvc4App.Models.Module>)ViewBag.Parent;
}

@if (Model != null) {
    using (Html.BeginForm()) {
    @Html.HiddenFor(c => c.Id)
    @Html.ValidationSummary(true,"带*为必填项")
    <table>
		<tr>
			<th>模块名称</th>
			<td>
				@Html.EditorFor(c => c.Title)
				@Html.ValidationMessageFor(c => c.Title)
			</td>
            <th>父级模块</th>
			<td>
				@Html.DropDownListFor(c => c.BelongTo, new SelectList(parList, "Id", "Title", Model.BelongTo),"--请选择--")
				@Html.ValidationMessageFor(c => c.BelongTo)
			</td>
		<tr>
			<th>动作</th>
			<td>
				@Html.EditorFor(c => c.Action)
				@Html.ValidationMessageFor(c => c.Action)
			</td>
			<th>控制器</th>
			<td>
				@Html.EditorFor(c => c.Controller)
				@Html.ValidationMessageFor(c => c.Controller)
			</td>
		<tr>

    </table>
    <p class="center">
        <input type="submit" value="提交" />
        <input type="button" value="返回" onclick="window.location='@Url.Action("Index")'" />
    </p>
    }
}